package com.sali.controller;

import com.sali.model.UserRegRequest;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * @description:
 * @author: sali
 * @date: 2024/7/20 21:08.
 * @version: 1.0
 */
@RestController
public class ValidatorController {

    /**
     * @description: 用户注册
     * @author: sali
     * @date: 2025/1/31
     * @param:  request
     */
    @PostMapping("/user/reg")
    public boolean RegUser(@Validated @RequestBody UserRegRequest request){
        return true;
    }


    /**
     * @description: Form校验
     * @author: sali
     * @date: 2025/1/31
     * @param:  validVO
     */
    @PostMapping(value = "/valid/test2")
    public String test2(@Validated UserRegRequest validVO){
        return "test2 valid success";
    }


}
